C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C    - REMOVE TABS
C    - PROGRAM UNITS RE-ORDERED
C    - ADDITIONAL YADEFS INCLUSIONS REMOVED
C    - DEFINES MOVED
C    - UNSPLIT LINES REMOVED
C    - CHANGE ZPTYPE TO ZPTYPE
C    - ADD GETLAB AND NAMEP FROM ISTUD
C    - USE NEW TOKEN WRITE ROUTINE, CHANGE IODTKO/IODCMO FOR
C      TKNCHN AND USE ZTKPTI AS AN INITIALISATION CALL.
C
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
 
 
 
 
 
 
 
 
C                                   parameter length
 
 
 
 
 
 
 
 
 
C following are for ZYCSDT (Canonicalise Symbol Data Types)
C
C--------   NODETP.MAC
C ------------------------------------------------------------------------
C
C  BUFFER ROUTINE FOR ZYNTYP, A PARAMETER OF 0 IS ILLEGAL.......
C
      INTEGER FUNCTION NODETP(NODE)
 
      INTEGER NODE, ZYNTYP
      EXTERNAL ZYNTYP
 
      IF(NODE .EQ. 0) THEN
        NODETP = -1
      ELSE
        NODETP = ZYNTYP(NODE)
      ENDIF
 
      END
C--------   GETLAB.MAC
C ------------------------------------------------------------------------
C    GETLAB - Get a replacement label
C
      SUBROUTINE GETLAB(LABNOD,REPLAB,FOUND)
C Given the label or label reference node LABNOD, return a replacement
C label REPLAB based on the replacement list OLDLBS/NEWLBS/NRLBS filled
C by SETLAB.  If label found, set FOUND = .TRUE., otherwise
C FOUND = .FALSE.
 
      INTEGER LABNOD, REPLAB(6)
      LOGICAL FOUND
 
      COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
      INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
 
      COMMON/LABLST/OLDLBS,NEWLBS,NRLBS
      INTEGER OLDLBS(6,200),NEWLBS(6,200),NRLBS
 
      SAVE
 
      INTEGER TYPE,SYMVAL(8),LABLO(6),I
 
      INTEGER ZYDOWN,ZYNTYP,EQUAL
      EXTERNAL ZYDOWN,ZYNTYP,ZYGTSY,ZYGTST,SCOPY
C Check that LABNOD is of type N_LABEL or N_LABELREF.
      TYPE = ZYNTYP(LABNOD)
      IF (TYPE .NE. 115 .AND. TYPE .NE. 116)
     +      CALL ERROR('GETLAB: Node of Inappropriate Type.')
 
C Get the label and locate it in the label list.
      CALL ZYGTSY(-ZYDOWN(LABNOD),SYMVAL)
      CALL ZYGTST(SYMVAL(2),LABLO)
      DO 10 I=1,NRLBS
         IF (EQUAL(LABLO,OLDLBS(1,I)) .EQ. -2) THEN
           CALL SCOPY(NEWLBS(1,I),1,REPLAB,1)
           FOUND = .TRUE.
           RETURN
         ENDIF
   10 CONTINUE
 
C Label not found on list.
      FOUND = .FALSE.
 
      END
C--------   NAMEP.MAC
      INTEGER FUNCTION NAMEP(NODE,NAME)
C Return 'yes' or 'no' according to whether the subtree rooted
C at NODE contains a node of type N_NAME whose associated string
C is NAME.
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
 
      SAVE
      INTEGER NODE, POINTR, TYPE,
     +          STACK(500),NAME(*),
     +          SYMVAL(8),TEXT(1322)
      INTEGER ZYROOT, ZYNTYP, ZYDOWN, ZYNEXT, ZYUP, PUSH, POP,
     +          EQUAL
      EXTERNAL ZYINPT, ZYROOT, ZPTINT, ZYNTYP, ZYDOWN, ZCHOUT,
     +           ZYNEXT, ZYUP, PUSH, POP, ZYGTSY,
     +           ZYGTST, ZPTMES, EQUAL
 
      STACK(1) = -1
 
      POINTR = NODE
10      CONTINUE
      TYPE = ZYNTYP(POINTR)
      IF(TYPE .EQ. 108) THEN
         CALL ZYGTSY(-ZYDOWN(POINTR),SYMVAL)
         CALL ZYGTST(SYMVAL(2),TEXT)
         IF(EQUAL(TEXT,NAME) .EQ. -2) THEN
            NAMEP = -2
            RETURN
         END IF
      END IF
      IF(PUSH(POINTR,STACK) .EQ. -1)CALL ERROR('Stack Full.',2)
      POINTR = ZYDOWN(POINTR)
C If POINTR > 0, node is not a leaf.
      IF(POINTR .GT. 0) GO TO 10
C Node is a leaf.
C Can't go down, try next unless we are at NODE.
      POINTR = POP(STACK)
      IF(POINTR .EQ. NODE) THEN
         NAMEP = -3
         RETURN
      END IF
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) GO TO 10
C Can't go next, pop until next is possible or return to NODE is complete.
        POINTR = POP(STACK)
      IF(POINTR .EQ. -1 .OR. POINTR .EQ. NODE) THEN
         NAMEP = -3
         RETURN
      END IF
20      CONTINUE
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) THEN
         GO TO 10
      ELSE
         POINTR = POP(STACK)
         IF(POINTR .EQ. -1 .OR. POINTR .EQ. NODE) THEN
            NAMEP = -3
            RETURN
         END IF
         GO TO 20
      END IF
      END
C--------   COMOUT.MAC
C ----------------------------------------------------------------------
C
C       C O M O U T  -   Output Block of Comments
C
 
        SUBROUTINE COMOUT(SNUM)
C Output one or more comments at statement number SNUM.
        INTEGER SNUM
 
        INTEGER BUFF(134)
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
 
        INTEGER ZYGTCM,ZYGNCM,LENGTH
        EXTERNAL ZYGTCM,ZYGNCM,LENGTH,ZTOKWR
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
 100    IF (ZYGTCM(IODCMT,SNUM,BUFF).EQ.-2) THEN
 200        CALL ZTOKWR(TCMMNT,LENGTH(BUFF),BUFF,TKNCHN)
            IF (ZYGNCM(IODCMT,BUFF).EQ.-2) GO TO 200
        END IF
 
        END
C--------   COMPAR.MAC
      INTEGER FUNCTION COMPAR(NODE1,NODE2)
C If the subtree rooted at NODE1 and the subtree rooted at NODE2
C are identical, return 'yes'; else return 'no'.
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
      SAVE
 
      INTEGER NODE1,NODE2,POINT1,POINT2,TYPE1,TYPE2,JUNK,
     +          STACK1(500),STACK2(500),
     +          SYMVAL(8),
     +          TEXT1(1322),TEXT2(1322)
 
      INTEGER ZYNTYP,ZYDOWN,ZYNEXT,PUSH,POP,EQUAL
 
      EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,PUSH,POP,ZYGTSY,ZYGTST,EQUAL
 
      STACK1(1) = -1
      STACK2(1) = -1
 
      POINT1 = NODE1
      POINT2 = NODE2
10      CONTINUE
      TYPE1 = ZYNTYP(POINT1)
      TYPE2 = ZYNTYP(POINT2)
      IF(TYPE1 .NE. TYPE2) THEN
C Corresponding nodes have different types.
         COMPAR = -3
         RETURN
      ELSE
C The types of corresponding nodes are the same.  Put them on their
C respective stacks.
         IF(PUSH(POINT1,STACK1) .EQ. -1)
     +        CALL ERROR('Stacks Full.',2)
         JUNK = PUSH(POINT2,STACK2)
C Are the corresponding nodes leaves?
         POINT1 = ZYDOWN(POINT1)
         POINT2 = ZYDOWN(POINT2)
C Since the nodes are of the same type, they are either both
C leaves or neither is a leaf.
         IF(POINT1 .GT. 0) GO TO 10
C Nodes are leaves.
C If the leaves are unnamed skip the check for same string.
         IF (POINT1 .EQ. 0) GO TO 100
C The leaves are named.  Check if they point to the same string.
         IF(TYPE1 .EQ. 108 .OR. TYPE1 .EQ. 40
     +        .OR. TYPE1 .EQ. 115 .OR. TYPE1 .EQ. 116) THEN
            CALL ZYGTSY(-POINT1,SYMVAL)
            CALL ZYGTST(SYMVAL(2),TEXT1)
            CALL ZYGTSY(-POINT2,SYMVAL)
            CALL ZYGTST(SYMVAL(2),TEXT2)
         ELSE
            CALL ZYGTST(-POINT1,TEXT1)
            CALL ZYGTST(-POINT2,TEXT2)
         END IF
         IF (EQUAL(TEXT1,TEXT2) .EQ. -3) THEN
C Strings are different, subtrees are not identical.
            COMPAR = -3
            RETURN
         END IF
100         CONTINUE
C Can't go down, pop stacks and try next.
         POINT1 = POP(STACK1)
         POINT2 = POP(STACK2)
C Have we arrived back at NODE1/NODE2?
         IF (POINT1 .EQ. NODE1) THEN
            IF (POINT2 .NE. NODE2) CALL ERROR('Internal Error 1.')
C Subtrees are identical.
            COMPAR = -2
            RETURN
         END IF
         POINT1 = ZYNEXT(POINT1)
         POINT2 = ZYNEXT(POINT2)
         IF (POINT1 .GT. 0 .AND. POINT2 .GT. 0) GO TO 10
         IF (POINT1 .GT. 0 .AND. POINT2 .LE. 0 .OR.
     +         POINT2 .GT. 0 .AND. POINT1 .LE. 0) THEN
C Subtrees have different structure - not identical.
            COMPAR = -3
            RETURN
         END IF
C Can't go next on either subtree. Pop stacks until next is possible
C or return to NODE1/NODE2 is complete.
           POINT1 = POP(STACK1)
           POINT2 = POP(STACK2)
         IF (POINT1 .EQ. -1) THEN
            IF (POINT2 .NE. -1) CALL ERROR('Internal -1 2.')
C Subtrees are identical.
            COMPAR = -2
            RETURN
         END IF
         IF (POINT1 .EQ. NODE1) THEN
            IF (POINT2 .NE. NODE2) CALL ERROR('Internal -1 3.')
C Subtrees are identical.
            COMPAR = -2
            RETURN
         END IF
20         CONTINUE
         POINT1 = ZYNEXT(POINT1)
         POINT2 = ZYNEXT(POINT2)
         IF (POINT1 .GT. 0 .AND. POINT2 .GT. 0) GO TO 10
         IF (POINT1 .GT. 0 .AND. POINT2 .LE. 0 .OR.
     +         POINT2 .GT. 0 .AND. POINT1 .LE. 0) THEN
C Subtrees have different structure - not identical.
            COMPAR = -3
            RETURN
         END IF
C Can't go next on either subtree.
           POINT1 = POP(STACK1)
           POINT2 = POP(STACK2)
         IF (POINT1 .EQ. -1) THEN
            IF (POINT2 .NE. -1) CALL ERROR('Internal -1 4.')
C Subtrees are identical.
            COMPAR = -2
            RETURN
         END IF
         IF (POINT1 .EQ. NODE1) THEN
            IF (POINT2 .NE. NODE2) CALL ERROR('Internal -1 5.')
C Subtrees are identical.
            COMPAR = -2
            RETURN
         END IF
         GO TO 20
      END IF
      END
C--------   DEPSET.MAC
      SUBROUTINE DEPSET(NODE,DNODES,NRDEPS)
      INTEGER NODE,DNODES(*),NRDEPS
C Given the assignment statement rooted at NODE, fill DNODES with the
C nodes of the dependency set of the statement; i.e., the collection of
C nodes of type N_NAME and of type N_ARELM in the expressions on both
C sides of the assignment statement.  The number of elements of the
C dependency set is returned as NRDEPS.
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
 
      INTEGER POINTR,TYPE,STACK(500),RHSNOD,LHSNOD
 
      INTEGER ZYNTYP,ZYDOWN,ZYNEXT,PUSH,POP
      EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,PUSH,POP
 
      SAVE
 
      NRDEPS = 0
      STACK(1) = -1
 
      IF (ZYNTYP(NODE) .NE. 49) CALL ERROR('DEPSET: Input'
     +      //'Node Not An Assignment Statement.')
 
C Find leaves of type N_NAME and array elements on the l.h.s.
      POINTR = ZYDOWN(NODE)
      IF (ZYNTYP(POINTR) .EQ. 115) POINTR = ZYNEXT(POINTR)
      LHSNOD = POINTR
30      CONTINUE
      IF(PUSH(POINTR,STACK) .EQ. -1)CALL ERROR('DEPSET:Stack Full.',
     +                                             2)
      TYPE = ZYNTYP(POINTR)
      IF (TYPE .EQ. 104) THEN
C Node is an array element.  Put into dependency set.
         NRDEPS = NRDEPS + 1
         DNODES(NRDEPS) = POINTR
      END IF
      POINTR = ZYDOWN(POINTR)
C If POINTR > 0, node is not a leaf. If POINTR = 0, node is an unnamed
C leaf.
      IF (POINTR .GT. 0) GO TO 30
C Node is a leaf. Put into dependency set if of type N_NAME.
      POINTR = POP(STACK)
      IF (TYPE .EQ. 108) THEN
         NRDEPS = NRDEPS + 1
         DNODES(NRDEPS) = POINTR
      END IF
C Leaf has been processed. Can't go down; try next unless we have
C finished the l.h.s.
      IF(POINTR .EQ. LHSNOD) GO TO 50
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) GO TO 30
 
C Can't go next, pop until next is possible or return to LHSNOD is complete.
        POINTR = POP(STACK)
      IF(POINTR .EQ. -1 .OR. POINTR .EQ. LHSNOD) GO TO 50
40      CONTINUE
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) THEN
         GO TO 30
      ELSE
         POINTR = POP(STACK)
         IF(POINTR .EQ. -1 .OR. POINTR .EQ. LHSNOD) GO TO 50
         GO TO 40
      END IF
 
50      CONTINUE
      STACK(1) = -1
 
C Find leaves of type N_NAME and array elements on the r.h.s.
      POINTR = ZYDOWN(NODE)
      IF (ZYNTYP(POINTR) .EQ. 115) POINTR = ZYNEXT(POINTR)
      POINTR = ZYNEXT(POINTR)
      RHSNOD = POINTR
10      CONTINUE
      IF(PUSH(POINTR,STACK) .EQ. -1)CALL ERROR('DEPSET:Stack Full.',
     +                                             2)
      TYPE = ZYNTYP(POINTR)
      IF (TYPE .EQ. 104) THEN
C Node is an array element.  Put into dependency set.
         NRDEPS = NRDEPS + 1
         DNODES(NRDEPS) = POINTR
      END IF
      POINTR = ZYDOWN(POINTR)
C If POINTR > 0, node is not a leaf. If POINTR = 0, node is an unnamed
C leaf.
      IF (POINTR .GT. 0) GO TO 10
C Node is a leaf. Put into dependency set if of type N_NAME.
      POINTR = POP(STACK)
      IF (TYPE .EQ. 108) THEN
         NRDEPS = NRDEPS + 1
         DNODES(NRDEPS) = POINTR
      END IF
C Leaf has been processed. Can't go down; try next unless we have
C finished the r.h.s.
      IF(POINTR .EQ. RHSNOD) RETURN
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) GO TO 10
C Can't go next, pop until next is possible or return to RHSNOD is complete.
        POINTR = POP(STACK)
      IF(POINTR .EQ. -1 .OR. POINTR .EQ. RHSNOD) RETURN
20      CONTINUE
      POINTR = ZYNEXT(POINTR)
      IF(POINTR .GT. 0) THEN
         GO TO 10
      ELSE
         POINTR = POP(STACK)
         IF(POINTR .EQ. -1 .OR. POINTR .EQ. RHSNOD) RETURN
         GO TO 20
      END IF
      END
C--------   DOTRM.MAC
C ----------------------------------------------------------------------
C            D O T R M -  Output a DO statement  with a specified
C                    termination label.
 
        SUBROUTINE DOTRM(NODE,TRMLBL,TKNCHN)
        INTEGER NODE,TRMLBL(*),TKNCHN
 
        INTEGER STYPE,PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,XDOTRM,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
      IF (STYPE .EQ. 61) THEN
           CALL XDOTRM(PTR,TRMLBL,TKNCHN)
        ELSE
           CALL ERROR('DOTRM: Statement 126 a DO.')
        END IF
        CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
 
        END
C--------   GETSTR.MAC
        SUBROUTINE GETSTR(NODE,STRING)
C Get the string associated with a leaf node.
 
      INTEGER NODE,STRING(*)
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
      SAVE
      INTEGER SYMVAL(8),POINTR,TYPE
 
      INTEGER ZYDOWN,ZYNTYP
        EXTERNAL ERROR,ZYGTSY,ZYGTST,ZYDOWN,ZYNTYP
 
      STRING(1) = 129
      POINTR = ZYDOWN(NODE)
C Node is not a leaf:
      IF (POINTR .GT. 0) CALL ERROR('GETSTR: Node Is Not a Leaf.')
C Node is an unnamed leaf:
      IF (POINTR .EQ. 0) RETURN
C Node is a named leaf:
      TYPE = ZYNTYP(NODE)
      IF(TYPE .EQ. 108 .OR. TYPE .EQ. 40
     +     .OR. TYPE .EQ. 115 .OR. TYPE .EQ. 116) THEN
         CALL ZYGTSY(-POINTR,SYMVAL)
         CALL ZYGTST(SYMVAL(2),STRING)
      ELSE
         CALL ZYGTST(-POINTR,STRING)
      END IF
 
      RETURN
      END
C--------   IFLAB.MAC
C ----------------------------------------------------------------------
C
C         I F L A B   -   Output an IF statement, making the following
C                    transformation:
C
C                    If the IF is a logical IF and the object statement
C                    is a GO TO, replace the label on the GO TO. If
C                    the IF is an arithmetic IF, replace the three
C                    object labels.
C
 
        SUBROUTINE IFLAB(NODE,TKNCHN)
        INTEGER NODE,TKNCHN
 
      COMMON/LABLST/OLDLBS,NEWLBS,NRLBS
      INTEGER OLDLBS(6,200),NEWLBS(6,200),NRLBS
 
        INTEGER STYPE,PTR,DUMMY(2),LABLN(6),TYPE,SYMVAL(8)
      LOGICAL FOUND
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT,LENGTH
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,LENGTH,
     +           GETLAB,ZYGTSY,ZYGTST,XIFLAB,YEXPR,YSTMT,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
        IF (STYPE.EQ.57 .OR. STYPE.EQ.55 .OR.
     +           STYPE.EQ.58) THEN
            CALL XIFLAB(PTR,TKNCHN)
            CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
        ELSE IF (STYPE.EQ.56) THEN
            CALL ZTOKWR(TIF,0,DUMMY,TKNCHN)
            CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            CALL YEXPR(PTR,TKNCHN)
            CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            PTR=ZYNEXT(PTR)
          TYPE = ZYNTYP(PTR)
          IF (TYPE .EQ. 51) THEN
             CALL GETLAB(ZYDOWN(PTR),LABLN,FOUND)
             IF (.NOT. FOUND) THEN
C Transfer is out of DO loop, output same label.
                CALL ZYGTSY(-ZYDOWN(ZYDOWN(PTR)),SYMVAL)
                  CALL ZYGTST(SYMVAL(2),LABLN)
             END IF
               CALL ZTOKWR(TGOTO,0,DUMMY,TKNCHN)
             CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
               CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
          ELSE
             CALL YSTMT(PTR,TKNCHN)
          END IF
        ELSE
            CALL ERROR('UIF: Don''t understand statement type.')
        END IF
 
        END
C--------   NOPARN.MAC
C---------------------------------------------------------------------
        LOGICAL FUNCTION NOPARN(NODE)
C Return .TRUE. or .FALSE. according to whether the string associated
C with the named leaf node NODE need not be parenthesized because certain
C sufficient conditions guaranteeing this conclusion hold.
 
      INTEGER NODE
 
        COMMON/IO/ IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
        INTEGER IODTKN,IODCMI,IODCMT,IODTKO,IODCMO,TKNCHN
      SAVE
      INTEGER TYPEUP,PREVND
 
      INTEGER ZYDOWN,ZYNTYP,ZYUP,ZYPREV
        EXTERNAL ERROR,ZYDOWN,ZYNTYP,ZYUP,ZYPREV
 
      NOPARN = .FALSE.
 
      IF (ZYDOWN(NODE) .GE. 0) CALL ERROR('NOPARN: Node Is Not '
     +                     //'a Named Leaf.')
C Node is a named leaf.
 
      TYPEUP = ZYNTYP(ZYUP(NODE))
      PREVND = ZYPREV(NODE)
 
C Name is already parenthesized.
      IF (TYPEUP .EQ. 101) THEN
         NOPARN = .TRUE.
         RETURN
      END IF
 
C Name is an unsigned index of an array element.
      IF (PREVND .NE. 0) THEN
         IF ((ZYNTYP(PREVND) .NE. 115)
     +         .AND. (TYPEUP .EQ. 104)) THEN
            NOPARN = .TRUE.
            RETURN
         END IF
      END IF
 
      END
C--------   POP.MAC
C ********************************************************************
      INTEGER FUNCTION POP(STACK)
C Pop an item from the stack.  STACK must have been initialized to
C have STACK(1) = err.
 
      INTEGER STACK(500),I
 
C Return the item at the top of the stack.  If the stack is empty,
C err is returned.
      POP = STACK(1)
 
C Pop the stack.
      DO 10 I=1,500
         IF(STACK(I) .EQ. -1) GO TO 20
         STACK(I) = STACK(I+1)
10      CONTINUE
 
   20 CONTINUE
      END
C--------   PUSH.MAC
C ********************************************************************
      INTEGER FUNCTION PUSH(ITEM,STACK)
C Push an item onto the stack.  STACK must have been initialized to
C have STACK(1) = err.
 
      INTEGER ITEM,STACK(500),I,J
 
C Find the end of the stack.
      DO 10 I=1,500-1
         IF(STACK(I) .EQ. -1) GO TO 20
10      CONTINUE
C If the stack is full, return err.
      PUSH = -1
      RETURN
 
C Push down the stack and insert item at the top.
20      CONTINUE
      DO 30 J=I,1,-1
         STACK(J+1) = STACK(J)
30      CONTINUE
 
      STACK(1) = ITEM
      PUSH = -2
 
      END
C--------   UASGN.MAC
C ----------------------------------------------------------------------
C
C         U A S G N   -   Output an assignment statement in which NAME
C                    appears so that each occurrence of NAME is
C                    replaced by (REPNAM + ICON*(E3)) where E3 is
C                    an expression rooted at INCNOD.  If INCNOD=0,
C                    then *(E3) is omitted.  If INCNOD = -1, then
C                    NAME is replaced by REPNAM - ICON
 
        SUBROUTINE UASGN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
        INTEGER STYPE,PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,XNASGN,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
      IF (STYPE .EQ. 49) THEN
            CALL XNASGN(PTR,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        ELSE
            CALL ERROR('UASGN: Not an assignment statement.')
        END IF
        CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
 
        END
C--------   UASGU.MAC
C ----------------------------------------------------------------------
C
C         U A S G U   -   Output an assignment statement in which NAME
C                    appears so that each occurrence of NAME is
C                    replaced by (NAME + ICON*(E3)) where E3 is
C                    an expression rooted at INCNOD.  If INCNOD=0,
C                    then E3=1 and *(E3) is omitted.  If INCNOD=-1
C                    then NAME is replaced by NAME - ICON.
 
        SUBROUTINE UASGU(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
        INTEGER STYPE,PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,XNASGU,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
      IF (STYPE .EQ. 49) THEN
            CALL XNASGU(PTR,NAME,ICON,INCNOD,TKNCHN)
        ELSE
            CALL ERROR('UASGU: Not an assignment statement.')
        END IF
        CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
 
        END
C--------   UDO.MAC
C ----------------------------------------------------------------------
C            U D O    -   Output a DO statement in which NAME
C                    appears in the DO specification so
C                    that each occurrence of NAME is
C                    replaced by (NAME + ICON*(E3)) where E3 is
C                    an expression rooted at INCNOD.  If INCNOD=0,
C                    then E3=1 and *(E3) is omitted.  If INCNOD=-1
C                    then NAME is replaced by NAME - ICON.
C                    Also the termination label is to be TRMLBL.
 
        SUBROUTINE UDO(NODE,NAME,ICON,INCNOD,TRMLBL,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TRMLBL(*),TKNCHN
 
        INTEGER STYPE,PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,XYUDO,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
      IF (STYPE .EQ. 61) THEN
           CALL XYUDO(PTR,NAME,ICON,INCNOD,TRMLBL,TKNCHN)
        ELSE
            CALL ERROR('UDO: Statement 126 a DO.')
        END IF
        CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
 
        END
C--------   UDOSP.MAC
C ----------------------------------------------------------------------
C
C         U D O S P   -   Output a DO specification in which NAME appears
C                    so that each occurrence of NAME is
C                    replaced by (NAME + ICON*(E3)) where E3 is
C                    an expression rooted at INCNOD.  If INCNOD=0,
C                    then E3=1 and *(E3) is omitted.  If INCNOD=-1,
C                    then NAME is replaced by NAME - ICON.
C
 
        SUBROUTINE UDOSP(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
        INTEGER PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNEXT,ZYDOWN
        EXTERNAL ZYNEXT,ZYDOWN,ZTOKWR,YLEAF,YEXPRU
 
        DATA DUMMY(1)/129/
 
        PTR=ZYDOWN(NODE)
        CALL YLEAF(PTR,TKNCHN)
        CALL ZTOKWR(TEQUAL,0,DUMMY,TKNCHN)
        PTR=ZYNEXT(PTR)
        CALL YEXPRU(PTR,NAME,ICON,INCNOD,TKNCHN)
        PTR=ZYNEXT(PTR)
        CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
        CALL YEXPRU(PTR,NAME,ICON,INCNOD,TKNCHN)
        PTR=ZYNEXT(PTR)
        IF (PTR.NE.0) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            CALL YEXPRU(PTR,NAME,ICON,INCNOD,TKNCHN)
        END IF
 
        END
C--------   UIF.MAC
C ----------------------------------------------------------------------
C
C         U I F     -     Output an IF statement in which NAME
C                    appears so that each occurrence of NAME is
C                    replaced by (NAME + ICON*(E3)) where E3 is
C                    an expression rooted at INCNOD.  If INCNOD=0,
C                    then E3=1 and *(E3) is omitted.
C                    If the IF object statement is a GO TO, replace
C                    the label reference.
C
 
        SUBROUTINE UIF(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
      COMMON/LABLST/OLDLBS,NEWLBS,NRLBS
      INTEGER OLDLBS(6,200),NEWLBS(6,200),NRLBS
 
        INTEGER STYPE,PTR,DUMMY(2),LABLN(6),TYPE,SYMVAL(8)
      LOGICAL FOUND
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT,LENGTH,NAMEP
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,LENGTH,GETLAB,
     +           ZYGTSY,ZYGTST,NAMEP,XYUIF,YEXPRU,UASGU,YSTMT,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
        IF (STYPE.EQ.57 .OR. STYPE.EQ.55 .OR.
     +           STYPE.EQ.58) THEN
            CALL XYUIF(PTR,NAME,ICON,INCNOD,TKNCHN)
            CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
        ELSE IF (STYPE.EQ.56) THEN
            CALL ZTOKWR(TIF,0,DUMMY,TKNCHN)
            CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            CALL YEXPRU(PTR,NAME,ICON,INCNOD,TKNCHN)
            CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            PTR=ZYNEXT(PTR)
          TYPE = ZYNTYP(PTR)
          IF (TYPE .EQ. 51) THEN
             CALL GETLAB(ZYDOWN(PTR),LABLN,FOUND)
             IF (.NOT. FOUND) THEN
C Transfer is out of DO loop, output same label.
                CALL ZYGTSY(-ZYDOWN(ZYDOWN(PTR)),SYMVAL)
                  CALL ZYGTST(SYMVAL(2),LABLN)
             END IF
               CALL ZTOKWR(TGOTO,0,DUMMY,TKNCHN)
             CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
               CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
          ELSE IF (TYPE .EQ. 49 .AND. NAMEP(PTR,NAME) .EQ. -2)
     +               THEN
             CALL UASGU(PTR,NAME,ICON,INCNOD,TKNCHN)
          ELSE
             CALL YSTMT(PTR,TKNCHN)
          END IF
        ELSE
            CALL ERROR('UIF: Don''t understand statement type.')
        END IF
 
        END
C--------   XDOTRM.MAC
C ----------------------------------------------------------------------
C
C       X D O T R M  -  Output a DO statement as specified in DOTRM.
C
C
 
      SUBROUTINE XDOTRM(NODE,TRMLBL,TKNCHN)
      INTEGER NODE,TRMLBL(*),TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER ZYNEXT,LENGTH
      EXTERNAL ZYNEXT,ZTOKWR,LENGTH,XYDOSP
 
      CALL ZTOKWR(TDO,0,TRMLBL,TKNCHN)
      CALL ZTOKWR(TDCNST,LENGTH(TRMLBL),TRMLBL,TKNCHN)
      CALL XYDOSP(ZYNEXT(NODE),TKNCHN)
 
      END
C--------   XIFLAB.MAC
C ----------------------------------------------------------------------
C
C       X I F L A B  -  Handles all IF/ELSEIF statements except logical IF
C                  as specified in IFLAB.
 
        SUBROUTINE XIFLAB(NODE,TKNCHN)
        INTEGER NODE,TKNCHN
 
      COMMON/LABLST/OLDLBS,NEWLBS,NRLBS
      INTEGER OLDLBS(6,200),NEWLBS(6,200),NRLBS
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER DUMMY(2),NTYPE,REFNOD,LABLN(6)
      LOGICAL FOUND
 
        SAVE
 
        INTEGER ZYNEXT,ZYNTYP,ZYUP,LENGTH
        EXTERNAL ZYNEXT,ZYNTYP,ZYUP,ZTOKWR,GETLAB,LENGTH,YEXPR,ERROR
 
        DATA DUMMY(1)/129/
 
        NTYPE=ZYNTYP(ZYUP(NODE))
        IF (NTYPE.EQ.58) THEN
            CALL ZTOKWR(TELSIF,0,DUMMY,TKNCHN)
        ELSE
            CALL ZTOKWR(TIF,0,DUMMY,TKNCHN)
        END IF
        CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        CALL YEXPR(NODE,TKNCHN)
        CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
        IF (NTYPE.EQ.55) THEN
C Replace the three labels.
          REFNOD = ZYNEXT(NODE)
          CALL GETLAB(REFNOD,LABLN,FOUND)
          IF (.NOT. FOUND) THEN
            CALL ZMESS('XIFLAB: First Label Reference Not Found.',2)
            CALL PUTLIN(LABLN, 2)
            CALL ZMESS(':refers to do loop termination statement?.',2)
            CALL ZQUIT(-1)
          ENDIF
          CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
          REFNOD = ZYNEXT(REFNOD)
          CALL GETLAB(REFNOD,LABLN,FOUND)
          IF (.NOT. FOUND) THEN
            CALL ZMESS('XIFLAB: Second Label Reference Not Found.',2)
            CALL PUTLIN(LABLN, 2)
            CALL ZMESS(':refers to do loop termination statement?.',2)
            CALL ZQUIT(-1)
          ENDIF
          CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
          REFNOD = ZYNEXT(REFNOD)
          CALL GETLAB(REFNOD,LABLN,FOUND)
          IF (.NOT. FOUND) THEN
            CALL ZMESS('XIFLAB: Third Label Reference Not Found.',2)
            CALL PUTLIN(LABLN, 2)
            CALL ZMESS(':refers to do loop termination statement?.',2)
            CALL ZQUIT(-1)
          ENDIF
          CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
        ELSE
            CALL ZTOKWR(TTHEN,0,DUMMY,TKNCHN)
        END IF
 
        END
C--------   XNASGN.MAC
C ----------------------------------------------------------------------
C
C       X N A S G N   -   Output an assignment statement
C
 
      SUBROUTINE XNASGN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
      INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
      INTEGER DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER ZYNEXT
      EXTERNAL ZYNEXT,ZTOKWR,YITEMN,YEXPRN
 
      CALL YITEMN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
      CALL ZTOKWR(TEQUAL,0,DUMMY,TKNCHN)
      CALL YEXPRN(ZYNEXT(NODE),NAME,REPNAM,ICON,INCNOD,TKNCHN)
 
      END
C--------   XNASGU.MAC
C ----------------------------------------------------------------------
C
C       X N A S G U   -   Output an assignment statement
C
 
      SUBROUTINE XNASGU(NODE,NAME,ICON,INCNOD,TKNCHN)
      INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
      INTEGER DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER ZYNEXT
      EXTERNAL ZYNEXT,ZTOKWR,YITEMU,YEXPRU
 
      CALL YITEMU(NODE,NAME,ICON,INCNOD,TKNCHN)
      CALL ZTOKWR(TEQUAL,0,DUMMY,TKNCHN)
      CALL YEXPRU(ZYNEXT(NODE),NAME,ICON,INCNOD,TKNCHN)
 
      END
C--------   XSASGN.MAC
C ----------------------------------------------------------------------
C
C       X S A S G N   -   Output an assignment statement
C
 
      SUBROUTINE XSASGN(NODE,REDNOD,SUBNOD,TKNCHN)
      INTEGER NODE,REDNOD,SUBNOD,TKNCHN
 
      INTEGER DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER ZYNEXT
      EXTERNAL ZYNEXT,ZTOKWR,YITEM,YEXPR
 
      CALL YITEMS(NODE,REDNOD,SUBNOD,TKNCHN)
      CALL ZTOKWR(TEQUAL,0,DUMMY,TKNCHN)
      CALL YEXPRS(ZYNEXT(NODE),REDNOD,SUBNOD,TKNCHN)
 
      END
C--------   XYUDO.MAC
C ----------------------------------------------------------------------
C
C       X Y U D O   -   Output a DO statement as specified in UDO.
C
C
 
      SUBROUTINE XYUDO(NODE,NAME,ICON,INCNOD,TRMLBL,TKNCHN)
      INTEGER NODE,NAME(*),ICON(*),INCNOD,TRMLBL(*),TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER ZYNEXT,LENGTH
      EXTERNAL ZYNEXT,ZTOKWR,LENGTH,UDOSP
 
      CALL ZTOKWR(TDO,0,TRMLBL,TKNCHN)
      CALL ZTOKWR(TDCNST,LENGTH(TRMLBL),TRMLBL,TKNCHN)
      CALL UDOSP(ZYNEXT(NODE),NAME,ICON,INCNOD,TKNCHN)
 
      END
C--------   XYUIF.MAC
C ----------------------------------------------------------------------
C
C   X Y U I F   -   Handles all IF/ELSEIF statements except logical IF
C                   as specified in UIF.
 
      SUBROUTINE XYUIF(NODE,NAME,ICON,INCNOD,TKNCHN)
      INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
      COMMON/LABLST/OLDLBS,NEWLBS,NRLBS
      INTEGER OLDLBS(6,200),NEWLBS(6,200),NRLBS
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
      INTEGER NTYPE,REFNOD,LABLN(6)
      LOGICAL FOUND
 
      SAVE
 
      INTEGER ZYNEXT,ZYNTYP,ZYUP,LENGTH
      EXTERNAL ZYNEXT,ZYNTYP,ZYUP,ZTOKWR,GETLAB,LENGTH,YEXPRU,ERROR,
     +         PUTLIN,ZCHOUT,ZMESS
 
      NTYPE=ZYNTYP(ZYUP(NODE))
      IF (NTYPE.EQ.58) THEN
        CALL ZTOKWR(TELSIF,0,LABLN,TKNCHN)
      ELSE
        CALL ZTOKWR(TIF,0,LABLN,TKNCHN)
      END IF
      CALL ZTOKWR(TLPARN,0,LABLN,TKNCHN)
      CALL YEXPRU(NODE,NAME,ICON,INCNOD,TKNCHN)
      CALL ZTOKWR(TRPARN,0,LABLN,TKNCHN)
 
      IF (NTYPE.EQ.55) THEN
C Replace the three labels.
        REFNOD = ZYNEXT(NODE)
        CALL GETLAB(REFNOD,LABLN,FOUND)
        IF (.NOT. FOUND) GO TO 999
        CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
        CALL ZTOKWR(TCOMMA,0,LABLN,TKNCHN)
 
        REFNOD = ZYNEXT(REFNOD)
        CALL GETLAB(REFNOD,LABLN,FOUND)
        IF (.NOT. FOUND) GO TO 999
        CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
        CALL ZTOKWR(TCOMMA,0,LABLN,TKNCHN)
 
        REFNOD = ZYNEXT(REFNOD)
        CALL GETLAB(REFNOD,LABLN,FOUND)
        IF (.NOT. FOUND) GO TO 999
        CALL ZTOKWR(TDCNST,LENGTH(LABLN),LABLN,TKNCHN)
 
      ELSE
        CALL ZTOKWR(TTHEN,0,LABLN,TKNCHN)
      END IF
      RETURN
 
  999 CONTINUE
      CALL ZCHOUT('Arithmetic IF: Label .', 1)
      CALL PUTLIN(LABLN, 1)
      CALL ZMESS(' 126 found...', 1)
      CALL ERROR('[Tool Aborting].')
 
      END
C--------   YAELMS.MAC
C ----------------------------------------------------------------------
C
C       Y A E L M S   -   Output token stream for an array_element_name
C
 
        SUBROUTINE YAELMS(NODE,REDNOD,SUBNOD,TKNCHN)
        INTEGER NODE,REDNOD,SUBNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2)
 
        INTEGER ZYDOWN,ZYNEXT,LENGTH
        EXTERNAL ZYDOWN,ZYNEXT,LENGTH,ZTOKWR
 
        DATA DUMMY(1)/129/
 
        PTR=ZYDOWN(NODE)
        CALL YLEAF(PTR,TKNCHN)
        CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        PTR=ZYNEXT(PTR)
 
100     CALL YEXPRS(PTR,REDNOD,SUBNOD,TKNCHN)
        PTR=ZYNEXT(PTR)
        IF (PTR.GT.0) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            GOTO 100
        END IF
        CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
 
        END
C--------   YEXPRN.MAC
C ----------------------------------------------------------------------
C
C       Y E X P R N  -   Output an expression
C
 
        SUBROUTINE YEXPRN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2),UP,DOWN,NTYPE,NEXT,UPTYPE
 
        INTEGER ZYDOWN,ZYNEXT,ZYNTYP,ZYUP
        EXTERNAL ZYDOWN,ZYNEXT,ZYNTYP,ZTOKWR,ZYUP,YLEAFN
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
 
C
C Going down
C
 100    DOWN=ZYDOWN(PTR)
        NTYPE=ZYNTYP(PTR)
        IF (DOWN.LE.0) THEN
            IF (NTYPE.NE.106)
     +         CALL YLEAFN(PTR,NAME,REPNAM,ICON,INCNOD,TKNCHN)
            GOTO 1000
        END IF
        IF (NTYPE.EQ.97) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.46) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.101 .OR. NTYPE.EQ.102) THEN
            CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.88) THEN
            CALL ZTOKWR(TNOT,0,DUMMY,TKNCHN)
        END IF
        PTR=DOWN
        GOTO 100
C
C Going up (or next if this isn't the last)
C
 1000   IF (PTR.EQ.NODE) RETURN
        UP=ZYUP(PTR)
        UPTYPE=ZYNTYP(UP)
        IF (UPTYPE.EQ.101) THEN
            CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            PTR=UP
            GOTO 1000
        ELSE IF (UPTYPE.EQ.97 .OR. UPTYPE.EQ.46 .OR.
     +           UPTYPE.EQ.88) THEN
            PTR=UP
            GOTO 1000
        END IF
        NEXT=ZYNEXT(PTR)
        IF (NEXT.EQ.0) THEN
            IF (UPTYPE.EQ.119 .OR. UPTYPE.EQ.104 .OR.
     +          UPTYPE.EQ.102 .OR. UPTYPE.EQ.105) THEN
C Check for special case of no list (N_FUNREF only)
                IF (ZYDOWN(UP).EQ.PTR)
     +              CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
                CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            END IF
            PTR=UP
            GOTO 1000
        END IF
C NEXT.NE.0
        IF (UPTYPE.EQ.95) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.96) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.98) THEN
            CALL ZTOKWR(TSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.99) THEN
            CALL ZTOKWR(TSLASH,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.100) THEN
            CALL ZTOKWR(TDSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.102) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.84) THEN
            CALL ZTOKWR(TEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.85) THEN
            CALL ZTOKWR(TNEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.87) THEN
            CALL ZTOKWR(TAND,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.86) THEN
            CALL ZTOKWR(TOR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.70) THEN
            CALL ZTOKWR(TCNCAT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.90) THEN
            CALL ZTOKWR(TLE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.89) THEN
            CALL ZTOKWR(TLT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.93) THEN
            CALL ZTOKWR(TGT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.94) THEN
            CALL ZTOKWR(TGE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.91) THEN
            CALL ZTOKWR(TEQ,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.92) THEN
            CALL ZTOKWR(TNE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.105) THEN
            CALL ZTOKWR(TCOLON,0,DUMMY,TKNCHN)
        ELSE
C Must be N_ARELM or N_FUNREF or N_SUBSTR
            IF (ZYDOWN(UP).EQ.PTR) THEN
                CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            ELSE
                CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            END IF
        END IF
        PTR=NEXT
        GOTO 100
 
        END
C--------   YEXPRS.MAC
C ----------------------------------------------------------------------
C
C       Y E X P R S  -   Output an expression
C
 
        SUBROUTINE YEXPRS(NODE,REDNOD,SUBNOD,TKNCHN)
        INTEGER NODE,REDNOD,SUBNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2),UP,DOWN,NTYPE,NEXT,UPTYPE
 
        INTEGER ZYDOWN,ZYNEXT,ZYNTYP,ZYUP,COMPAR
        EXTERNAL ZYDOWN,ZYNEXT,ZYNTYP,ZTOKWR,ZYUP,COMPAR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
 
C
C Going down
C
C  Substitute SUBNOD for REDNOD when latter encountered.
100      IF (COMPAR(PTR,REDNOD) .EQ. -2) THEN
         CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
         CALL YEXPR(SUBNOD,TKNCHN)
         CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
         GO TO 1000
      END IF
        DOWN=ZYDOWN(PTR)
        NTYPE=ZYNTYP(PTR)
        IF (DOWN.LE.0) THEN
            IF (NTYPE.NE.106) CALL YLEAF(PTR,TKNCHN)
            GOTO 1000
        END IF
        IF (NTYPE.EQ.97) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.46) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.101 .OR. NTYPE.EQ.102) THEN
            CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.88) THEN
            CALL ZTOKWR(TNOT,0,DUMMY,TKNCHN)
        END IF
        PTR=DOWN
        GOTO 100
C
C Going up (or next if this isn't the last)
C
 1000   IF (PTR.EQ.NODE) RETURN
        UP=ZYUP(PTR)
        UPTYPE=ZYNTYP(UP)
        IF (UPTYPE.EQ.101) THEN
            CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            PTR=UP
            GOTO 1000
        ELSE IF (UPTYPE.EQ.97 .OR. UPTYPE.EQ.46 .OR.
     +           UPTYPE.EQ.88) THEN
            PTR=UP
            GOTO 1000
        END IF
        NEXT=ZYNEXT(PTR)
        IF (NEXT.EQ.0) THEN
            IF (UPTYPE.EQ.119 .OR. UPTYPE.EQ.104 .OR.
     +          UPTYPE.EQ.102 .OR. UPTYPE.EQ.105) THEN
C Check for special case of no list (N_FUNREF only)
                IF (ZYDOWN(UP).EQ.PTR)
     +              CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
                CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            END IF
            PTR=UP
            GOTO 1000
        END IF
C NEXT.NE.0
        IF (UPTYPE.EQ.95) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.96) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.98) THEN
            CALL ZTOKWR(TSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.99) THEN
            CALL ZTOKWR(TSLASH,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.100) THEN
            CALL ZTOKWR(TDSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.102) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.84) THEN
            CALL ZTOKWR(TEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.85) THEN
            CALL ZTOKWR(TNEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.87) THEN
            CALL ZTOKWR(TAND,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.86) THEN
            CALL ZTOKWR(TOR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.70) THEN
            CALL ZTOKWR(TCNCAT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.90) THEN
            CALL ZTOKWR(TLE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.89) THEN
            CALL ZTOKWR(TLT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.93) THEN
            CALL ZTOKWR(TGT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.94) THEN
            CALL ZTOKWR(TGE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.91) THEN
            CALL ZTOKWR(TEQ,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.92) THEN
            CALL ZTOKWR(TNE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.105) THEN
            CALL ZTOKWR(TCOLON,0,DUMMY,TKNCHN)
        ELSE
C Must be N_ARELM or N_FUNREF or N_SUBSTR
            IF (ZYDOWN(UP).EQ.PTR) THEN
                CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            ELSE
                CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            END IF
        END IF
        PTR=NEXT
        GOTO 100
 
        END
C--------   YEXPRU.MAC
C ----------------------------------------------------------------------
C
C       Y E X P R U  -   Output an expression
C
 
        SUBROUTINE YEXPRU(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2),UP,DOWN,NTYPE,NEXT,UPTYPE
 
        INTEGER ZYDOWN,ZYNEXT,ZYNTYP,ZYUP
        EXTERNAL ZYDOWN,ZYNEXT,ZYNTYP,ZTOKWR,ZYUP,YLEAFU
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
 
C
C Going down
C
 100    DOWN=ZYDOWN(PTR)
        NTYPE=ZYNTYP(PTR)
        IF (DOWN.LE.0) THEN
            IF (NTYPE.NE.106)
     +         CALL YLEAFU(PTR,NAME,ICON,INCNOD,TKNCHN)
            GOTO 1000
        END IF
        IF (NTYPE.EQ.97) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.46) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.101 .OR. NTYPE.EQ.102) THEN
            CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        ELSE IF (NTYPE.EQ.88) THEN
            CALL ZTOKWR(TNOT,0,DUMMY,TKNCHN)
        END IF
        PTR=DOWN
        GOTO 100
C
C Going up (or next if this isn't the last)
C
 1000   IF (PTR.EQ.NODE) RETURN
        UP=ZYUP(PTR)
        UPTYPE=ZYNTYP(UP)
        IF (UPTYPE.EQ.101) THEN
            CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            PTR=UP
            GOTO 1000
        ELSE IF (UPTYPE.EQ.97 .OR. UPTYPE.EQ.46 .OR.
     +           UPTYPE.EQ.88) THEN
            PTR=UP
            GOTO 1000
        END IF
        NEXT=ZYNEXT(PTR)
        IF (NEXT.EQ.0) THEN
            IF (UPTYPE.EQ.119 .OR. UPTYPE.EQ.104 .OR.
     +          UPTYPE.EQ.102 .OR. UPTYPE.EQ.105) THEN
C Check for special case of no list (N_FUNREF only)
                IF (ZYDOWN(UP).EQ.PTR)
     +              CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
                CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
            END IF
            PTR=UP
            GOTO 1000
        END IF
C NEXT.NE.0
        IF (UPTYPE.EQ.95) THEN
            CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.96) THEN
            CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.98) THEN
            CALL ZTOKWR(TSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.99) THEN
            CALL ZTOKWR(TSLASH,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.100) THEN
            CALL ZTOKWR(TDSTAR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.102) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.84) THEN
            CALL ZTOKWR(TEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.85) THEN
            CALL ZTOKWR(TNEQV,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.87) THEN
            CALL ZTOKWR(TAND,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.86) THEN
            CALL ZTOKWR(TOR,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.70) THEN
            CALL ZTOKWR(TCNCAT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.90) THEN
            CALL ZTOKWR(TLE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.89) THEN
            CALL ZTOKWR(TLT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.93) THEN
            CALL ZTOKWR(TGT,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.94) THEN
            CALL ZTOKWR(TGE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.91) THEN
            CALL ZTOKWR(TEQ,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.92) THEN
            CALL ZTOKWR(TNE,0,DUMMY,TKNCHN)
        ELSE IF (UPTYPE.EQ.105) THEN
            CALL ZTOKWR(TCOLON,0,DUMMY,TKNCHN)
        ELSE
C Must be N_ARELM or N_FUNREF or N_SUBSTR
            IF (ZYDOWN(UP).EQ.PTR) THEN
                CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            ELSE
                CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            END IF
        END IF
        PTR=NEXT
        GOTO 100
 
        END
C--------   YITEMN.MAC
C ----------------------------------------------------------------------
C
C       Y I T E M N   -   Output leaf/ardcl/arelm/substr
C
 
        SUBROUTINE YITEMN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER NTYPE,PTR,DUMMY(2)
        LOGICAL CHARA
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,YSUBST,YNRELM,YLEAF,YARDCL,YCHLEN
 
        DATA DUMMY(1)/129/
 
        NTYPE=ZYNTYP(NODE)
        IF (NTYPE.EQ.31) THEN
            CHARA=.TRUE.
            PTR=ZYDOWN(NODE)
            NTYPE=ZYNTYP(PTR)
        ELSE
            CHARA=.FALSE.
            PTR=NODE
        END IF
        IF (NTYPE.EQ.103) THEN
            CALL YSUBST(PTR,TKNCHN)
        ELSE IF (NTYPE.EQ.104) THEN
            CALL YNRELM(PTR,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        ELSE IF (NTYPE.EQ.21) THEN
            CALL YLEAF(ZYDOWN(PTR),TKNCHN)
            CALL YARDCL(ZYNEXT(ZYDOWN(PTR)),TKNCHN)
        ELSE
            CALL YLEAF(PTR,TKNCHN)
        END IF
        IF (CHARA) CALL YCHLEN(-ZYNEXT(PTR),TKNCHN)
 
        END
C--------   YITEMS.MAC
C ----------------------------------------------------------------------
C
C       Y I T E M S   -   Output leaf/ardcl/arelm/substr
C
 
        SUBROUTINE YITEMS(NODE,REDNOD,SUBNOD,TKNCHN)
        INTEGER NODE,REDNOD,SUBNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER NTYPE,PTR,DUMMY(2)
        LOGICAL CHARA
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT
 
        DATA DUMMY(1)/129/
 
        NTYPE=ZYNTYP(NODE)
        IF (NTYPE.EQ.31) THEN
            CHARA=.TRUE.
            PTR=ZYDOWN(NODE)
            NTYPE=ZYNTYP(PTR)
        ELSE
            CHARA=.FALSE.
            PTR=NODE
        END IF
        IF (NTYPE.EQ.103) THEN
            CALL YSUBST(PTR,TKNCHN)
        ELSE IF (NTYPE.EQ.104) THEN
            CALL YAELMS(PTR,REDNOD,SUBNOD,TKNCHN)
        ELSE IF (NTYPE.EQ.21) THEN
            CALL YLEAF(ZYDOWN(PTR),TKNCHN)
            CALL YARDCL(ZYNEXT(ZYDOWN(PTR)),TKNCHN)
        ELSE
            CALL YLEAF(PTR,TKNCHN)
        END IF
        IF (CHARA) CALL YCHLEN(-ZYNEXT(PTR),TKNCHN)
 
        END
C--------   YITEMU.MAC
C ----------------------------------------------------------------------
C
C       Y I T E M U   -   Output leaf/ardcl/arelm/substr
C
 
        SUBROUTINE YITEMU(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER NTYPE,PTR,DUMMY(2)
        LOGICAL CHARA
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,YSUBST,YNRELU,YLEAF,YARDCL,YCHLEN
 
        DATA DUMMY(1)/129/
 
        NTYPE=ZYNTYP(NODE)
        IF (NTYPE.EQ.31) THEN
            CHARA=.TRUE.
            PTR=ZYDOWN(NODE)
            NTYPE=ZYNTYP(PTR)
        ELSE
            CHARA=.FALSE.
            PTR=NODE
        END IF
        IF (NTYPE.EQ.103) THEN
            CALL YSUBST(PTR,TKNCHN)
        ELSE IF (NTYPE.EQ.104) THEN
            CALL YNRELU(PTR,NAME,ICON,INCNOD,TKNCHN)
        ELSE IF (NTYPE.EQ.21) THEN
            CALL YLEAF(ZYDOWN(PTR),TKNCHN)
            CALL YARDCL(ZYNEXT(ZYDOWN(PTR)),TKNCHN)
        ELSE
            CALL YLEAF(PTR,TKNCHN)
        END IF
        IF (CHARA) CALL YCHLEN(-ZYNEXT(PTR),TKNCHN)
 
        END
C--------   YLEAFN.MAC
C ----------------------------------------------------------------------
C
C       Y L E A F N   -   Output the token for a leaf node
C                       Leaf nodes are: all names and constants,
C                                       and the "asterisk" node.
C
 
        SUBROUTINE YLEAFN(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
        INTEGER TEXT(1322),SYMBOL(8),TOKTYP,NTYPE,
     +          ERRTXT(4),ENDTXT(4),DUMMY(2),CONONE(2),NUM1,VLICON
      LOGICAL NIXLRP
 
        INTEGER ZYNTYP,ZYDOWN,LENGTH,EQUAL,CTOI
      LOGICAL NOPARN
        EXTERNAL ZYNTYP,ZYDOWN,LENGTH,ZYGTSY,ZYGTST,ZTOKWR,ERROR,
     +           ZPTINT,ZCHOUT,EQUAL,ZTOCAP,ZMESS,YEXPR,CTOI,NOPARN
 
        DATA ERRTXT/69,82,82,129/,ENDTXT/69,78,68,129/
        DATA DUMMY(1) /129/
      DATA CONONE/49,129/
 
        NTYPE=ZYNTYP(NODE)
        IF (NTYPE.EQ.108 .OR. NTYPE.EQ.115 .OR.
     +      NTYPE.EQ.116 .OR. NTYPE.EQ.40) THEN
            TEXT(1)=129
            IF (NTYPE.EQ.40)
     +          CALL ZTOKWR(TSLASH,0,TEXT,TKNCHN)
            CALL ZYGTSY(-ZYDOWN(NODE),SYMBOL)
            CALL ZYGTST(SYMBOL(2),TEXT)
            IF (NTYPE.EQ.108 .OR. NTYPE.EQ.40) THEN
                TOKTYP=TNAME
            ELSE
                TOKTYP=TDCNST
            END IF
        ELSE IF (NTYPE.EQ.17) THEN
            TOKTYP=TSTAR
            TEXT(1)=129
        ELSE
            CALL ZYGTST(-ZYDOWN(NODE),TEXT)
            IF (NTYPE.EQ.107) THEN
                TOKTYP=TDCNST
            ELSE IF (NTYPE.EQ.110) THEN
                TOKTYP=TRCNST
            ELSE IF (NTYPE.EQ.111) THEN
                TOKTYP=TPCNST
            ELSE IF (NTYPE.EQ.109) THEN
                TOKTYP=TLCNST
            ELSE IF (NTYPE.EQ.114) THEN
                TOKTYP=TCCNST
            ELSE IF (NTYPE.EQ.113) THEN
                TOKTYP=THCNST
            ELSE IF (NTYPE.EQ.120) THEN
                TOKTYP=TNAME
            ELSE IF (NTYPE.EQ.118) THEN
                CALL ZTOCAP(TEXT)
                IF (EQUAL(TEXT,ENDTXT).EQ.-2) THEN
                    TOKTYP=TENDKD
                ELSE IF (EQUAL(TEXT,ERRTXT).EQ.-2) THEN
                    TOKTYP=TERRKD
                ELSE
                    TOKTYP=TNAME
                END IF
            ELSE
                CALL ZCHOUT('YLEAFN: Invalid leaf node (Number .',2)
                CALL ZPTINT(NODE,1,2)
                CALL ZCHOUT(',type .',2)
                CALL ZPTINT(NTYPE,1,2)
                CALL ZMESS(').',2)
                CALL ERROR('PROGRAM ABORTED.')
            END IF
        END IF
      IF(NTYPE .EQ. 108 .AND. EQUAL(TEXT,NAME) .EQ. -2) THEN
         NIXLRP = NOPARN(NODE)
           IF (.NOT. NIXLRP) CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
         CALL ZTOKWR(TOKTYP,LENGTH(REPNAM),REPNAM,TKNCHN)
C Calculate the value of ICON so we can simplify the output when ICON = 0.
         NUM1 = 1
         VLICON = CTOI(ICON,NUM1)
         IF (VLICON .GT. 0) THEN
            IF (INCNOD .EQ. -1) THEN
                 CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
            ELSE
                 CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
            END IF
              CALL ZTOKWR(TDCNST,LENGTH(ICON),ICON,TKNCHN)
         END IF
         IF (INCNOD .GT. 0) THEN
              CALL ZTOKWR(TSTAR,0,DUMMY,TKNCHN)
              CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            CALL YEXPR(INCNOD,TKNCHN)
              CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
         END IF
           IF (.NOT. NIXLRP) CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
      ELSE
           CALL ZTOKWR(TOKTYP,LENGTH(TEXT),TEXT,TKNCHN)
      END IF
        IF (NTYPE.EQ.40) THEN
            TEXT(1)=129
            CALL ZTOKWR(TSLASH,0,TEXT,TKNCHN)
        END IF
 
        END
C--------   YLEAFU.MAC
C ----------------------------------------------------------------------
C
C       Y L E A F U   -   Output the token for a leaf node
C                       Leaf nodes are: all names and constants,
C                                       and the "asterisk" node.
C
 
        SUBROUTINE YLEAFU(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
        INTEGER TEXT(1322),SYMBOL(8),TOKTYP,NTYPE,
     +          ERRTXT(4),ENDTXT(4),DUMMY(2)
      LOGICAL NIXLRP
 
        INTEGER ZYNTYP,ZYDOWN,LENGTH,EQUAL
      LOGICAL NOPARN
        EXTERNAL ZYNTYP,ZYDOWN,LENGTH,ZYGTSY,ZYGTST,ZTOKWR,ERROR,
     +           ZPTINT,ZCHOUT,EQUAL,ZTOCAP,ZMESS,YEXPR,NOPARN
 
        DATA ERRTXT/69,82,82,129/,ENDTXT/69,78,68,129/
        DATA DUMMY(1) /129/
 
        NTYPE=ZYNTYP(NODE)
        IF (NTYPE.EQ.108 .OR. NTYPE.EQ.115 .OR.
     +      NTYPE.EQ.116 .OR. NTYPE.EQ.40) THEN
            TEXT(1)=129
            IF (NTYPE.EQ.40)
     +          CALL ZTOKWR(TSLASH,0,TEXT,TKNCHN)
            CALL ZYGTSY(-ZYDOWN(NODE),SYMBOL)
            CALL ZYGTST(SYMBOL(2),TEXT)
            IF (NTYPE.EQ.108 .OR. NTYPE.EQ.40) THEN
                TOKTYP=TNAME
            ELSE
                TOKTYP=TDCNST
            END IF
        ELSE IF (NTYPE.EQ.17) THEN
            TOKTYP=TSTAR
            TEXT(1)=129
        ELSE
            CALL ZYGTST(-ZYDOWN(NODE),TEXT)
            IF (NTYPE.EQ.107) THEN
                TOKTYP=TDCNST
            ELSE IF (NTYPE.EQ.110) THEN
                TOKTYP=TRCNST
            ELSE IF (NTYPE.EQ.111) THEN
                TOKTYP=TPCNST
            ELSE IF (NTYPE.EQ.109) THEN
                TOKTYP=TLCNST
            ELSE IF (NTYPE.EQ.114) THEN
                TOKTYP=TCCNST
            ELSE IF (NTYPE.EQ.113) THEN
                TOKTYP=THCNST
            ELSE IF (NTYPE.EQ.120) THEN
                TOKTYP=TNAME
            ELSE IF (NTYPE.EQ.118) THEN
                CALL ZTOCAP(TEXT)
                IF (EQUAL(TEXT,ENDTXT).EQ.-2) THEN
                    TOKTYP=TENDKD
                ELSE IF (EQUAL(TEXT,ERRTXT).EQ.-2) THEN
                    TOKTYP=TERRKD
                ELSE
                    TOKTYP=TNAME
                END IF
            ELSE
                CALL ZCHOUT('YLEAFU: Invalid leaf node (Number .',2)
                CALL ZPTINT(NODE,1,2)
                CALL ZCHOUT(',type .',2)
                CALL ZPTINT(NTYPE,1,2)
                CALL ZMESS(').',2)
                CALL ERROR('PROGRAM ABORTED.')
            END IF
        END IF
      IF(NTYPE .EQ. 108 .AND. EQUAL(TEXT,NAME) .EQ. -2) THEN
         NIXLRP = NOPARN(NODE)
           IF (.NOT. NIXLRP) CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
           CALL ZTOKWR(TOKTYP,LENGTH(TEXT),TEXT,TKNCHN)
         IF (INCNOD .EQ. -1) THEN
              CALL ZTOKWR(TMINUS,0,DUMMY,TKNCHN)
         ELSE
              CALL ZTOKWR(TPLUS,0,DUMMY,TKNCHN)
         END IF
           CALL ZTOKWR(TDCNST,LENGTH(ICON),ICON,TKNCHN)
         IF (INCNOD .GT. 0) THEN
              CALL ZTOKWR(TSTAR,0,DUMMY,TKNCHN)
              CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
            CALL YEXPR(INCNOD,TKNCHN)
              CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
         END IF
           IF (.NOT. NIXLRP) CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
      ELSE
           CALL ZTOKWR(TOKTYP,LENGTH(TEXT),TEXT,TKNCHN)
      END IF
        IF (NTYPE.EQ.40) THEN
            TEXT(1)=129
            CALL ZTOKWR(TSLASH,0,TEXT,TKNCHN)
        END IF
 
        END
C--------   YNRELM.MAC
C ----------------------------------------------------------------------
C
C       Y N R E L M   -   Output token stream for an array_element_name
C
 
        SUBROUTINE YNRELM(NODE,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),REPNAM(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2)
 
        INTEGER ZYDOWN,ZYNEXT,LENGTH
        EXTERNAL ZYDOWN,ZYNEXT,LENGTH,ZTOKWR,YLEAF,YEXPRN
 
        DATA DUMMY(1)/129/
 
        PTR=ZYDOWN(NODE)
        CALL YLEAF(PTR,TKNCHN)
        CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        PTR=ZYNEXT(PTR)
 
 100    CALL YEXPRN(PTR,NAME,REPNAM,ICON,INCNOD,TKNCHN)
        PTR=ZYNEXT(PTR)
        IF (PTR.GT.0) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            GOTO 100
        END IF
        CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
 
        END
C--------   YNRELU.MAC
C ----------------------------------------------------------------------
C
C       Y N R E L U   -   Output token stream for an array_element_name
C
 
        SUBROUTINE YNRELU(NODE,NAME,ICON,INCNOD,TKNCHN)
        INTEGER NODE,NAME(*),ICON(*),INCNOD,TKNCHN
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER PTR,DUMMY(2)
 
        INTEGER ZYDOWN,ZYNEXT,LENGTH
        EXTERNAL ZYDOWN,ZYNEXT,LENGTH,ZTOKWR,YLEAF,YEXPRU
 
        DATA DUMMY(1)/129/
 
        PTR=ZYDOWN(NODE)
        CALL YLEAF(PTR,TKNCHN)
        CALL ZTOKWR(TLPARN,0,DUMMY,TKNCHN)
        PTR=ZYNEXT(PTR)
 
 100    CALL YEXPRU(PTR,NAME,ICON,INCNOD,TKNCHN)
        PTR=ZYNEXT(PTR)
        IF (PTR.GT.0) THEN
            CALL ZTOKWR(TCOMMA,0,DUMMY,TKNCHN)
            GOTO 100
        END IF
        CALL ZTOKWR(TRPARN,0,DUMMY,TKNCHN)
 
        END
C--------   YSTMTS.MAC
C ----------------------------------------------------------------------
C
C       Y S T M T S   -   Output an assignment statement containing an
C                    occurrence of a subtree rooted at REDNOD on
C                    the rhs is so that the output otherwise taken
C                     from REDNOD is taken instead from the subtree
C                    rooted at SUBNOD.
C
 
        SUBROUTINE YSTMTS(NODE,REDNOD,SUBNOD,TKNCHN)
        INTEGER NODE,REDNOD,SUBNOD,TKNCHN
 
        INTEGER STYPE,PTR,DUMMY(2)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.1
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYNTYP,ZYDOWN,ZYNEXT
        EXTERNAL ZYNTYP,ZYDOWN,ZYNEXT,ZTOKWR,YLEAF,XSASGN,ERROR
 
        DATA DUMMY(1)/129/
 
        PTR=NODE
        STYPE=ZYNTYP(PTR)
        PTR=ZYDOWN(PTR)
        IF (PTR.NE.0) THEN
            IF (ZYNTYP(PTR).EQ.115) THEN
                CALL YLEAF(PTR,TKNCHN)
                PTR=ZYNEXT(PTR)
            END IF
        END IF
        IF (STYPE.EQ.49) THEN
            CALL XSASGN(PTR,REDNOD,SUBNOD,TKNCHN)
        ELSE
            CALL ERROR('YSTMTS: Not An Assignment Statement.')
        END IF
        CALL ZTOKWR(TZEOS,0,DUMMY,TKNCHN)
 
        END
